package top.zhouze.common.base;

import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;

/**
 * @author 周仄
 * @since 2023/7/27 17:18
 */
public abstract class BaseTextWatcher implements TextWatcher {

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
    }

    @Override
    public void afterTextChanged(Editable s) {
    }

    public void clear(EditText editText) {
        editText.removeTextChangedListener(this);
        editText.setText("");
        editText.addTextChangedListener(this);
    }
}
